package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-06 11:02
 * @类说明：
 * @修改记录：
 */
@ApiModel(value = "MdataMonitorDTO", description = "数据监控表")
@Table(name = "bdp_dgs_mdata_monitor")
public class MdataMonitorDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 主数据变更ID
     */
    @LogField
    @ApiModelProperty(value = "主数据变更ID", name = "changeId")
    @FieldRemark(column = "change_id", field = "changeId", name = "主数据变更ID")
    private String changeId;

    /**
     * 系统ID
     */
    @LogField
    @ApiModelProperty(value = "系统ID", name = "applicationId")
    @FieldRemark(column = "application_id", field = "applicationId", name = "系统ID")
    private String applicationId;

    /**
     * 推送状态，1-待推送，2-推送中,3-已推送,4-推送失败
     */
    @LogField
    @ApiModelProperty(value = "推送状态", name = "pushStatus")
    @FieldRemark(column = "push_status", field = "pushStatus", name = "推送状态")
    private Integer pushStatus;

    /**
     * 推送时间
     */
    @LogField
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "推送时间", name = "pushTime")
    @FieldRemark(column = "push_time", field = "pushTime", name = "推送时间")
    private Date pushTime;

    @Transient
    private String applicationName;
    @Transient
    private Integer operType;
    @Transient
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operTime;
    @Transient
    private String operTypeName;
    @Transient
    private String pushStatusName;
    // 数据详情
    @Transient
    private String data;
    @Transient
    private String mdataName;

    public String getMdataName() {
        return mdataName;
    }

    public void setMdataName(String mdataName) {
        this.mdataName = mdataName;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getOperTypeName() {
        return operTypeName;
    }

    public void setOperTypeName(String operTypeName) {
        this.operTypeName = operTypeName;
    }

    public String getPushStatusName() {
        return pushStatusName;
    }

    public void setPushStatusName(String pushStatusName) {
        this.pushStatusName = pushStatusName;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public Integer getOperType() {
        return operType;
    }

    public void setOperType(Integer operType) {
        this.operType = operType;
    }

    public Date getOperTime() {
        return operTime;
    }

    public void setOperTime(Date operTime) {
        this.operTime = operTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getChangeId() {
        return changeId;
    }

    public void setChangeId(String changeId) {
        this.changeId = changeId;
    }

    public Date getPushTime() {
        return pushTime;
    }

    public void setPushTime(Date pushTime) {
        this.pushTime = pushTime;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public Integer getPushStatus() {
        return pushStatus;
    }

    public void setPushStatus(Integer pushStatus) {
        this.pushStatus = pushStatus;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_dgs_mdata_monitor";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_dgs_mdata_monitor";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
